import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    token:"",  //token
    userName:"",  //用户名   默认手机号
    mobile:"",  //手机号
    picture:"",  //头像
    roleType:"",  //角色类型 1.普通用户 2.残疾人  3.志愿者
    pwdFlag:"",    //密码状态
    resumeNo:"",  //简历id
    nickName:"",  //用户昵称
    // sex:"",       //性别
    localImgFlag:'', //是否是本地头像
    onLoading:null
  },
  mutations: {
    changeToken(state,value){
      state.token = value;
    },
    changeuserName(state,value){
      state.userName = value;
    },
    changemobile(state,value){
      state.mobile = value;
    },
    changepicture(state,value){
      state.picture = value;
    },
    changeroleType(state,value){
      state.roleType = value;
    },
    changepwdFlag(state,value){
      state.pwdFlag = value;
    },
    changeresumeNo(state,value){
      state.resumeNo = value;
    },
    changenickName(state,value){
      state.nickName = value;
    },
    changonLoading(state,value){
      state.onLoading = value;
    },
    // changsex(state,value){
    //   state.sex = value;
    // }
    changelocalImgFlag(state,value){
      state.localImgFlag = value;
    }
  },
  actions: {
  },
  modules: {
  },
  getters: {
    showpwdFlag: state => {
      return state.pwdFlag;
    },
    shownickName: state => {
      return state.nickName;
    },
    showpicture: state => {
      return state.picture;
    },
    showonLoading: state => {
      return state.onLoading;
    },
  }
})
